package com.weilus;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class Receiver {

    @RabbitListener(bindings = {@QueueBinding(
                                    value=@Queue(value = "direct.everyDayMoney"),
                                    exchange=@Exchange(RabbitmqConfig.EXCHANGE),
                                    key="everyDayMoney"
                                )},
                    containerFactory = "rabbitListenerContainerFactory")
    public void everyDayMoney(MQMessage msg) {
        log.info("MQ---everyDayMoney----收到参数: {}",msg);
    }


    @RabbitListener(bindings = {@QueueBinding(
                                    value=@Queue(value = "direct.loginLog"),
                                    exchange=@Exchange(RabbitmqConfig.EXCHANGE),
                                    key="loginLog"
                                )},
                    containerFactory = "rabbitListenerContainerFactory")
    public void loginLog(MQMessage msg) {
        log.info("MQ---loginLog----收到参数: {}",msg);
    }
}
